<!DOCTYPE html >
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>{$Think.config.APP_NAME}</title>
<load href="__PUBLIC__/easyapps/css/ui.all.css" />
<load href="__PUBLIC__/easyapps/css/theme-default.css" />
<load href="__PUBLIC__/easyapps/js/avalon.min.js" />
</head>
<style type="text/css">
.ms-controller{
    display:none;
}
tr{
    cursor: pointer;
}

</style>
<body ms-controller="EasyApps"  >
<!-- 侧边栏内容 -->
<div id="aside" class="offcanvas">
  <div class="offcanvas-bar">
    <ul data-widget="menu" class="sm-block-grid-1 menu menu-lv1 menu-offcanvas1 no-layout">
        <li class="menu-item"><a href="##">公司</a></li>
        <li class="menu-item"><a href="##">人物</a></li>
        <li class="menu-item"><a href="##">趋势</a></li>
        <li class="menu-item"><a href="##">投融资</a></li>
        <li class="menu-item"><a href="##">创业公司</a></li>
        <li class="menu-item"><a href="##">创业人物</a></li>
    </ul>
  </div>
</div>

<div class="container" ms-controller="Widget">
<header class="topbar margin-none">
    <h1 class="topbar-brand">
        <a href="#aside" data-offcanvas><span class="icon-bars"></span></a>
    </h1>
    <h1 class="topbar-brand">
        <a href="#">{$Think.config.APP_NAME}</a>
    </h1>
    <div class="collapse topbar-collapse" >
        <ul class="nav nav-pills topbar-nav">
            <li class="active"><a href="#">首页</a></li>
        </ul>
        <div class="topbar-right">
            <a href="#" target="_blank" class="btn btn-danger topbar-btn btn-sm" >v0.1</a>
            <a href="{:U('Admin/Index/chooseApp')}" class="btn btn-primary topbar-btn btn-sm" >切换</a>
            <a ms-click="clearMobileCache()" href="{:U('Admin/Index/clearMobileCache')}" class="btn btn-primary topbar-btn btn-sm" >刷新缓存</a>
            <a href="{:U('Admin/Index/changpw')}" class="btn btn-primary topbar-btn btn-sm"  >修改密码</a>
            <a class="btn btn-primary topbar-btn btn-sm" href="{:U('Admin/Public/logout')}" class="button tiny " >退出系统</a>
        </div>
    </div>

</header>

    <div class="g">
        <div class="col-md-2 left">
            <div class="sidebar ">
                <ul class="nav">
                    <li ><a href="{:U('Admin/AppInfo/import')}">基本资料</a></li>
                    <li class="nav-header">内容管理</li>
                    <li ><a href="{:U('Admin/Info/import')}">内容导入</a></li>
                    <li ><a href="{:U('Admin/Info/index')}">信息管理</a></li>

                    <li class="nav-header">风格样式</li>
                    <li ><a href="{:U('Admin/Templates/import')}">主题选择</a></li>
                    <li ><a href="{:U('Admin/Styles/index')}">样式管理</a></li>
                    <li ><a href="{:U('Admin/Nav/design')}">导航设计</a></li>
                    <li ><a href="{:U('Admin/Startpic/index')}" >启动动画</a></li>

                    <li class="nav-header">高级</li>
                    <li class="active"><a href="{:U('Admin/Widget/index')}" >插件安装</a></li>

                    <li class="nav-header">应用</li>
                    <li ><a href="{:U('Admin/Widget/index')}" >插件安装</a></li>

                    <li class="nav-header">挂件</li>
                    <li ><a href="{:U('Admin/Widget/index')}" >插件安装</a></li>

                </ul>
            </div>
        </div>
        <div class="col-md-10 main scrollable-vertical ">
            <ul class="md-block-grid-4 margin-top margin-left">
            <li ms-repeat="widget" class="padding-right " >
                <div class="panel panel-primary">
                    <div class="panel-hd">{{el.title}}</div>
                    <div class="panel-bd">                    
                        {{el.desc}}<br >{{el.author}}
                    </div>
                    <footer class="panel-footer">
                        <button class="btn btn-success btn-xs"><i class="icon-eye"></i>
                        预览</button>
                        <button ms-visible="el.install == 'false'" ms-click="install(el)" class="btn btn-primary btn-xs"><i class="icon-download"></i>
                        安装</button>
                        <button ms-click="uninstall(el)" ms-visible="el.install == 'true'"  class="btn btn-danger btn-xs"><i class="icon-trash-o"></i>
                        卸载</button>
                    </footer>
                </div>
            </li>
            </ul>
        </div>
    </div>
</div>



</body>
<load href="__PUBLIC__/easyapps/js/EasyApps.js" />
<script type="text/javascript">
avalon.config({
    debug:false,
})

require("mmRouter,nprogress/nprogress,jquery,app", function(avalon,nprogress,$,app) {

    var Widget = avalon.define('Widget', function(vm) {
        vm.widget = eval('({$widget})');
        vm.install = function(el){
            var url = 'admin.php?c=Widget&a=install';
            nprogress.start();
            var par = {};
            par['install'] = el.install;
            par['model'] = el.model;
            par['name'] = el.name;
            $.getJSON(url,par,function(resq){
                nprogress.done();
                if (resq['ret'] == 0) {
                    app.alert(resq['msg']);
                }else{
                    el.install = 'true';
                }
            })
        }



        vm.uninstall = function(el){
            var url = 'admin.php?c=Widget&a=uninstall';
            nprogress.start();
            var par = {};
            par['install'] = el.install;
            par['model'] = el.model;
            par['name'] = el.name;
            $.getJSON(url,par,function(resq){
                nprogress.done();
                if (resq['ret'] == 0) {
                    app.alert(resq['msg']);
                }else{
                    el.install = 'false';
                }
            })
        }

    })

    

    avalon.router.get("/)", function() {
        // var url = 'rest.php?c=Picture&a=getlist&'+'page='+page;
        // nprogress.start();
        // $.getJSON(url,function(resq){
        //     Spider.albumList = resq['volist'];
        //     nprogress.done();
        // })
    })


    avalon.history.start({
        basepath: "/weiduniang_app"
    })
    avalon.router.navigate("/")
    avalon.scan()
}) 

</script>
</html>